export default function ({
  data = [
    [1, 55],
    [2, 25],
    [3, 56],
    [4, 33],
    [5, 42],
    [6, 82],
    [7, 74],
    [8, 78],
    [9, 267],
    [10, 185],
    [11, 39],
    [12, 41],
    [13, 64],
    [14, 108],
    [15, 108],
    [16, 33],
    [17, 94],
    [18, 186],
    [19, 57],
    [20, 22],
    [21, 39],
    [22, 94],
    [23, 99],
    [24, 31],
    [25, 42],
    [26, 154],
    [27, 234],
    [28, 160],
    [29, 134],
    [30, 52],
    [31, 46],
  ],
} = {}) {
  const schema = [
    { name: 'order', index: 0, text: '经销商数量' },
    { name: 'distributor', index: 1, text: '订单品种数' },
  ];
  return {
    backgroundColor: 'transparent',
    color: ['#dd4444', '#fec42c', '#80F1BE'],
    grid: {
      x: '10%',
      x2: 150,
      y: '18%',
      y2: '10%',
    },
    tooltip: {
      formatter: function (obj) {
        var value = obj.value;
        return `
          ${schema[0].text}: ${value[0]}<br>
          ${schema[1].text}: ${value[1]}
        `;
      },
    },
    xAxis: {
      type: 'value',
      name: '经销商数量',
      nameTextStyle: {
        color: '#fff',
        fontSize: 14,
      },
      splitLine: {
        show: true,
        lineStyle: {
          color: 'rgba(25, 54, 58,.5)',
          width: 1,
        },
      },
      axisLine: {
        lineStyle: {
          color: '#3B585B',
        },
      },
      axisTick: {
        lineStyle: {
          color: '#777',
        },
      },
      axisLabel: {
        formatter: '{value}',
        textStyle: {
          color: '#fff',
          fontSize: 14,
        },
      },
    },
    yAxis: {
      type: 'value',
      name: '订单品种数',
      nameLocation: 'end',
      nameGap: 20,
      nameTextStyle: {
        color: '#fff',
        fontSize: 14,
      },
      axisLine: {
        lineStyle: {
          color: '#3B585B',
        },
      },
      axisTick: {
        lineStyle: {
          color: '#777',
        },
      },
      splitLine: {
        show: true,
        lineStyle: {
          color: 'rgba(25, 54, 58,.5)',
          width: 1,
        },
      },
      axisLabel: {
        textStyle: {
          color: '#fff',
        },
      },
    },
    series: [
      {
        name: '北京',
        type: 'scatter',
        symbolSize: 20,
        itemStyle: {
          color: data => {
            console.log(data);
            // TODO: 根据 data.value的值决定颜色值
            return 'yellow';
          },
        },
        data,
      },
    ],
  };
}
